package cn.gson.springmvc.model.pojos;

import javax.persistence.*;
import java.util.Collection;
import java.util.Objects;

@Entity
public class Dept {
    private int deptId;
    private String deptName;
    private String deptAddress;
    private Integer deptIsshow;


    @Id
    @Column(name = "dept_id", nullable = false)
    public int getDeptId() {
        return deptId;
    }

    public void setDeptId(int deptId) {
        this.deptId = deptId;
    }

    @Basic
    @Column(name = "dept_name", nullable = true, length = 30)
    public String getDeptName() {
        return deptName;
    }

    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }

    @Basic
    @Column(name = "dept_address", nullable = true, length = 30)
    public String getDeptAddress() {
        return deptAddress;
    }

    public void setDeptAddress(String deptAddress) {
        this.deptAddress = deptAddress;
    }

    @Basic
    @Column(name = "dept_isshow", nullable = true)
    public Integer getDeptIsshow() {
        return deptIsshow;
    }

    public void setDeptIsshow(Integer deptIsshow) {
        this.deptIsshow = deptIsshow;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Dept dept = (Dept) o;
        return deptId == dept.deptId &&
                Objects.equals(deptName, dept.deptName) &&
                Objects.equals(deptAddress, dept.deptAddress) &&
                Objects.equals(deptIsshow, dept.deptIsshow);
    }

    @Override
    public int hashCode() {
        return Objects.hash(deptId, deptName, deptAddress, deptIsshow);
    }
}
